package com.company.myfirstjmixproject.entity.enums;

import io.jmix.core.metamodel.datatype.impl.EnumClass;

import javax.annotation.Nullable;


public enum ProdTypeEnum implements EnumClass<String> {

    /**
     * 主产成品
     */
    COPRODUCT("COPRODUCT"),

    /**
     * 副产成品
     */
    BYPRODUCT("BYPRODUCT");

    private String id;

    ProdTypeEnum(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    @Nullable
    public static ProdTypeEnum fromId(String id) {
        for (ProdTypeEnum at : ProdTypeEnum.values()) {
            if (at.getId().equals(id)) {
                return at;
            }
        }
        return null;
    }
}